package com.blkj.modular.index.controller;

import cn.hutool.core.date.TimeInterval;
import com.alibaba.fastjson.JSONObject;
import com.blkj.common.annotation.Log;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author 北浪 2021/11/9
 */
@Controller
public class IndexController {

    private static final TimeInterval timer =  new TimeInterval();

    @RequestMapping({"","/index"})
    public String indexPage(){
        return "index";
    }

    @RequestMapping("test")
    @ResponseBody
    public String test(){
        JSONObject jsonObject = new JSONObject();
        int i = 0;
        while (i != 100) {
            i++;
        }
        jsonObject.put("num",i);
        return jsonObject.toJSONString();
    }

}
